package com.blb.eduadservice.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.blb.eduadservice.service.PromotionAdService;
import com.blb.pojo.PromotionAd;
import com.blb.pojo.ResponseResult;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("ad")
public class PromotionAdController {
    @Resource
    private PromotionAdService promotionAdService;

    @GetMapping("{id}")
    public ResponseResult getAdsBySpaceId(@PathVariable Long id){
        List<PromotionAd> adsBySpaceId = promotionAdService.getAdsBySpaceId(id);
        return ResponseResult.ok(adsBySpaceId);
    }
}
